package demo1;

class Solution2 {
    public int missingNumber(int[] nums) {
        int n = nums.length;
        int n1 = 0;
        for(int i = 0; i < nums.length; ++i){
           n1 += i - nums[i];
           
        }
        return n + n1;
    }
}